POV-Ray : Newsgroups : povray.binaries.images : Re: spline macro help need. - explain.jpg (1/1) : Re: spline macro help need. - explain.jpg (1/1) Server Time
11 Aug 2024 19:31:14 EDT (-0400)
  Re: spline macro help need. - explain.jpg (1/1)  
From: Mike Williams
Date: 7 Feb 2004 01:14:17
Message: <40248239@news.povray.org>
I can't reproduce the problem you're having at the left side of your chain,
but I can reproduce and fix the weird effect that happens in the middle. I'd
have to see more of your code before I can address the problem on the left.
Are you using some extra options in your create_spline call?


Problem 1: some of the links overlap

A POV cubic_spline can have as many extra points as you feel like. The part
of the spline that you evaluate is up to you.

A Colefax cubic_spline has one control point beyond the spline at each end.
Macros like link_spline start at the second point and stop at the
next-to-last point. If you've more than one control points at one end, then
link_spline will paint links into the control region.

The splinefollow.pov example happens to have two control points beyond the
spline at each end. When you convert it into a Colefax spline you should
delete these points, giving you an array size of 14 instead of 16.


Problem 2: there's a discontinuity in the middle

The macro doesn't link the first link in the spline to the last one
correctly. That's because a link is 1 unit long and the spline is 44.75268
units long. I changed the spline_step_size to make there be exactly 44 links
in the chain. That fixes this particular spline, for other splines you might
need to tweak it a bit to force the number of links to be even.

#declare Step = spline_length(S)/int(spline_length(S));
link_spline (S, spline_step_size(Step)+spline_step_twist(90))


Post a reply to this message


Attachments:
Download 'SPlineChain.jpg' (43 KB)

Preview of image 'SPlineChain.jpg'
SPlineChain.jpg


 

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.